# Contributor: Alexander Kulak <sa-dev@rainbow.by>
# Maintainer: Alexander Kulak <sa-dev@rainbow.by>
pkgname=alttab
pkgver=1.4.0
pkgrel=0
pkgdesc="X11 window switcher designed for minimalistic window managers"
url="https://github.com/sagb/alttab"
options="!check"
arch="all"
license="GPL-3.0-or-later"
makedepends="libx11-dev libxft-dev fts-dev libxrender-dev libxrandr-dev
	libpng-dev uthash-dev"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/sagb/alttab/archive/v$pkgver.tar.gz
	0001-Fix-memleaks-in-error-case.patch
	0002-Remove-check-around-free.patch
	"

prepare() {
	default_prepare
	./bootstrap.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var && \
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="263625e4dfabcb697fdf38b330fd7e179a36e5c1111fe8a2aa98a6eb1434c8ff20400f0317845bd5a0f0454baf6b59369ab25270953690f544d0923fc4deab3b  alttab-1.4.0.tar.gz
7368b0706ccca5ae70cb050912be06b718a9727f3460abd5f349834f16f0d45a643e3f0914875a0aaa5d275d55d10953b302eb1d0891e179a3ecf62fdd34fbd7  0001-Fix-memleaks-in-error-case.patch
d69d5b9d90d84cc8c7f54ba7132602ab4e3ed8b0bdcf3ff07cc317f093c925855dfd15f883809e710fb0cbfebcf05dbcdca58e69842e050ef7ad6dc903a52c1b  0002-Remove-check-around-free.patch"
